package com.sh.data.engine.application.model.annotation;

import jakarta.validation.Constraint;
import jakarta.validation.Payload;

import java.lang.annotation.*;

/**
 * 根据数据源的类型，校验不同的字段
 *
 * @author: mengzheng.mhc
 * @date: 2024/12/20 16:48
 */
@Documented
@Constraint(validatedBy = DataSourceConditionalFieldsValidator.class) // 绑定校验逻辑
@Target(ElementType.TYPE) // 注解作用于类级别
@Retention(RetentionPolicy.RUNTIME)
public @interface DataSourceConditionalFields {

    String message() default "Invalid data source config parameter values based on the data source type.";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
}
